#include <QtGui/QApplication>
#include "mainwindow.h"
#include "connector.h"
#include <QHttp>
#include <QSystemTrayIcon>
#include <QMenu>
#include "tryhandler.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    Connector c;
    QObject::connect(&w, SIGNAL(connectEd(QString)), &c, SLOT(connectEd(QString)));
    QObject::connect(&c, SIGNAL(connErr(QAbstractSocket::SocketError)), &w, SLOT(connErr(QAbstractSocket::SocketError)));

    TryHandler t;

    QObject::connect(&w, SIGNAL(answer(int,QString)), &c, SLOT(send(int,QString)));
    QObject::connect(&c, SIGNAL(decode(int,QIODevice*)), &w, SLOT(display(int,QIODevice*)));

    QObject::connect(&w, SIGNAL(proxySwitched(bool,QString,int)), &c, SLOT(proxySwitched(bool,QString,int)));
    w.show();



    return a.exec();
}
